// login.js
new Vue({
  el: "#app",
  data: {
    username: "",
    password: "",
    loading: false,
    message: "",
    messageType: "",
  },
  methods: {
    handleLogin() {
      this.loading = true;
      this.message = "";

      // 模拟API调用延迟
      setTimeout(() => {
        if (this.username === "admin" && this.password === "123") {
          this.message = "登录成功，正在跳转...";
          this.messageType = "success";

          // 在实际应用中，这里应该使用路由跳转
          setTimeout(() => {
            window.location.href =
              "file:///A:/%E5%B7%A5%E7%A8%8B/squad-server-manager/Squad%20HTML/Manager/index.html";
          }, 1000);
        } else {
          this.message = "用户名或密码错误，请重试。";
          this.messageType = "error";
        }
        this.loading = false;
      }, 800);
    },
  },
});
